home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / C / G320400.ZIP / G320400.DOC < prev    next >
Encoding:
Text File  |  1994-03-24  |  27.8 KB  |  377 lines

  1.     ------------------------------------------------------------------------
  2.     |                                                                      |
  3.     |                                                                      |
  4.     |                                                                      |
  5.     |                                                                      |
  6.     |                                                                      |
  7.     |                                                                      |
  8.     |                                                                      |
  9.     |                                                                      |
  10.     |                                                                      |
  11.     |                                                                      |
  12.     |                                                                      |
  13.     |                                                                      |
  14.     |                                                                      |
  15.     |                                                                      |
  16.     |                                                                      |
  17.     |                                                                      |
  18.     |                                                                      |
  19.     |                                                                      |
  20.     |                                                                      |
  21.     |                                                                      |
  22.     |                                                                      |
  23.     |                                                                      |
  24.     |                             G 3 2 0 4 0 0                            |
  25.     |                                                                      |
  26.     |                              Version 1.0                             |
  27.     |                                                                      |
  28.     |                Copyright (C) 1994, Geoff Friesen B.Sc.               |
  29.     |                         All rights reserved.                         |
  30.     |                                                                      |
  31.     |                                                                      |
  32.     |                                                                      |
  33.     |                                                                      |
  34.     |                                                                      |
  35.     |                                                                      |
  36.     |                                                                      |
  37.     |                                                                      |
  38.     |                                                                      |
  39.     |                                                                      |
  40.     |                                                                      |
  41.     |                                                                      |
  42.     |                                                                      |
  43.     |                                                                      |
  44.     |                                                                      |
  45.     |                                                                      |
  46.     |                                                                      |
  47.     |                                                                      |
  48.     |                                                                      |
  49.     |                                                                      |
  50.     |                                                                      |
  51.     |                                                                      |
  52.     ------------------------------------------------------------------------
  53.  
  54.     ------------------------------------------------------------------------
  55.     |                                                                      |
  56.     |                               G320400                                |
  57.     |                               -------                                |
  58.     |                                                                      |
  59.     | G320400 is a graphics library that supports the VGA 320x400 graphics |
  60.     | mode with 256 simultaneous colors.                                   |
  61.     |                                                                      |
  62.     | The following files make up this package.                            |
  63.     |                                                                      |
  64.     | G320400.DOC - the documentation that you are currently reading       |
  65.     | G320400.H   - a header containing useful constants and prototypes    |
  66.     | G320400.LIB - the large memory model implementation of the library   |
  67.     | MAC2G34.EXE - Macintosh PIC to G320400 G34 file converter            |
  68.     | PCX2G34.EXE - PCX to G320400 G34 file converter                      |
  69.     | VIEWG34.EXE - G34 file viewer                                        |
  70.     | COWBOY.G34  - sample G34 file                                        |
  71.     | G320400.C   - library source code                                    |
  72.     | MAC2G34.C   - Macintosh file converter source code                   |
  73.     | PCX2G34.C   - PCX file converter source code                         |
  74.     | VIEWG34.C   - G34 file viewer source code                            |
  75.     | VIEWG34.PRJ - G34 file viewer project file                           |
  76.     |                                                                      |
  77.     | Borland C++ v3.1 was used to develop this package.                   |
  78.     |                                                                      |
  79.     | G320400 supports two screen pages for graphics output.  The current  |
  80.     | page used for output is known as the active page.  The current visi- |
  81.     | ble page is known as the visual page.  The active page and the visi- |
  82.     | ble page can be the same page.                                       |
  83.     |                                                                      |
  84.     | The following functions are part of the library.                     |
  85.     |                                                                      |
  86.     | * word g_AndRect (word x, word y, char *buf);                        |
  87.     |                                                                      |
  88.     | Perform a bitwise AND of the active page whose upper-left corner is  |
  89.     | specified by (x,y) with the memory array pointed to by buf.  OK is   |
  90.     | returned if successful.  ERROR is returned if the library has not    |
  91.     | been installed or the arguments are out of range.                    |
  92.     |                                                                      |
  93.     | * word g_Circle (word x, word y, word r);                            |
  94.     |                                                                      |
  95.     | Draw a circle on the active page whose center is positioned at (x,y) |
  96.     | and having radius r.  OK is returned if successful.  If the library  |
  97.     | has not been installed then ERROR is returned.                       |
  98.     |                                                                      |
  99.     | * word g_Cls (word color);                                           |
  100.     |                                                                      |
  101.     | Clear the active page using color.  OK is returned if successful or  |
  102.     | ERROR if the library has not been installed.                         |
  103.     |                                                                      |
  104.     |                                                                      |
  105.     ------------------------------------------------------------------------
  106.                      -  2 -
  107.  
  108.     ------------------------------------------------------------------------
  109.     |                                                                      |
  110.     | * word g_CopyRect (word x, word y, char *buf);                       |
  111.     |                                                                      |
  112.     | Copy the contents of buf to the active page.  The upper-left corner  |
  113.     | of the resulting rectangle is specified by (x,y).  OK is returned if |
  114.     | successful.  ERROR is returned if the library has not been installed |
  115.     | or the arguments are out of range.                                   |
  116.     |                                                                      |
  117.     | * word g_DeInit (void);                                              |
  118.     |                                                                      |
  119.     | Deinitialize the library.  OK is returned if successful.  ERROR is   |
  120.     | returned if the library has not been installed.                      |
  121.     |                                                                      |
  122.     | * word g_Error (void);                                               |
  123.     |                                                                      |
  124.     | Return a number that identifies the most recent error.  A list of    |
  125.     | error constants are contained in G320400.H.                          |
  126.     |                                                                      |
  127.     | * word g_GetAPage (word *pageno);                                    |
  128.     |                                                                      |
  129.     | Obtain the active page number.  This number (0 or 1) is returned via |
  130.     | *pageno.  OK is returned if successful.  ERROR is returned if the    |
  131.     | library has not been installed.                                      |
  132.     |                                                                      |
  133.     | * word g_GetColor (word *_fcolor, word *_bcolor);                    |
  134.     |                                                                      |
  135.     | Obtain the current foreground and background colors used in render-  |
  136.     | ing images.  The foreground color is returned via *_fcolor and the   |
  137.     | background color via *_bcolor.  OK is returned if successful.  ERROR |
  138.     | is returned if the library has not been installed.                   |
  139.     |                                                                      |
  140.     | * word g_GetLineStyle (dword *_style);                               |
  141.     |                                                                      |
  142.     | Obtain the style used in drawing lines.  This style is returned via  |
  143.     | *_style.  OK is returned if successful.  ERROR is returned if the    |
  144.     | library has not been installed.                                      |
  145.     |                                                                      |
  146.     | * word g_GetLineWidth (word *_width);                                |
  147.     |                                                                      |
  148.     | Obtain the line width.  This width is returned via *_width.  OK is   |
  149.     | returned if successful.  ERROR is returned if the library has not    |
  150.     | been installed.                                                      |
  151.     |                                                                      |
  152.     | * word g_GetPalette (word index, word *r, word *g, word *b);         |
  153.     |                                                                      |
  154.     | Get the red, green, and blue components of the color entry found at  |
  155.     | index in the palette.  Return the red component via *r, green via *g |
  156.     | and blue via *b.  Index must range from 0-255.  OK is returned if    |
  157.     | successful.  ERROR is returned if library not installed or bad index |
  158.     |                                                                      |
  159.     ------------------------------------------------------------------------
  160.                      -  3 -
  161.  
  162.     ------------------------------------------------------------------------
  163.     |                                                                      |
  164.     | * word g_GetPixel (word x, word y, word *color);                     |
  165.     |                                                                      |
  166.     | Get the pixel color of the pixel at location (x,y) on the active     |
  167.     | page.  The color is returned via *color.  OK is returned if success- |
  168.     | ful.  ERROR is returned if the library has not been installed or the |
  169.     | arguments are out of range.                                          |
  170.     |                                                                      |
  171.     | * word g_GetRect (word x1, word y1, word x2, word y2, char *buf);    |
  172.     |                                                                      |
  173.     | Get the contents of the rectangle on the active page whose upper-    |
  174.     | left corner is located at (x1,y1) and lower-right corner at (x2,y2). |
  175.     | The contents are stored in buf which must be capable of storing at   |
  176.     | least 4+(x2-x1+1)*(y2-y1+1) bytes.  OK is returned if successful.    |
  177.     | ERROR is returned if the library has not been installed or the argu- |
  178.     | ments are out of range.                                              |
  179.     |                                                                      |
  180.     | * word g_GetVPage (word *pageno);                                    |
  181.     |                                                                      |
  182.     | Obtain the visual page number.  This number (0 or 1) is returned via |
  183.     | *pageno.  OK is returned if successful.  ERROR is returned if the    |
  184.     | library has not been installed.                                      |
  185.     |                                                                      |
  186.     | * word g_Init (void);                                                |
  187.     |                                                                      |
  188.     | Initialize the library.  The screen is set to the 320x400x256 graph- |
  189.     | ics mode.  The background color is set to BLACK and the foreground   |
  190.     | color to LIGHTGRAY.  The line style is set to SOLID and the width to |
  191.     | 1.  The current drawing position is set to (160,200).  The active    |
  192.     | and visual pages are set to 0.  OK is returned if successful.  ERROR |
  193.     | is returned if the library has not been installed or a VGA video     |
  194.     | card is not present.                                                 |
  195.     |                                                                      |
  196.     | * word g_LineTo (word x, word y);                                    |
  197.     |                                                                      |
  198.     | Draw a line from the current drawing position to (x,y) on the active |
  199.     | page.  OK is returned if successful.  ERROR is returned if the lib-  |
  200.     | rary has not been installed or the arguments are out of range.       |
  201.     |                                                                      |
  202.     | * word g_LoadG34 (char *filespec, char *buf);                        |
  203.     |                                                                      |
  204.     | Load a G34 file into memory pointed to by buf.  If a file extension  |
  205.     | is not specified then .G34 is assumed.  Buf must be large enough to  |
  206.     | hold the file.  OK is returned if successful.  ERROR is returned if  |
  207.     | the library has not been installed, the file cannot be opened or     |
  208.     | accessed, or the file is corrupt.                                    |
  209.     |                                                                      |
  210.     |                                                                      |
  211.     |                                                                      |
  212.     |                                                                      |
  213.     ------------------------------------------------------------------------
  214.                      -  4 -
  215.  
  216.     ------------------------------------------------------------------------
  217.     |                                                                      |
  218.     | * word g_MoveTo (word x, word y);                                    |
  219.     |                                                                      |
  220.     | Set the current drawing position to (x,y).  OK is returned if suc-   |
  221.     | cessful.  ERROR is returned if the library has not been installed or |
  222.     | the arguments are out of range.                                      |
  223.     |                                                                      |
  224.     | * word g_Rectangle (word x1, word y1, word x2, word y2);             |
  225.     |                                                                      |
  226.     | Draw a rectangle on the active page with upper-left corner at        |
  227.     | (x1,y1) and lower-right corner at (x2,y2).  OK is returned if suc-   |
  228.     | cessful.  ERROR is returned is the library has not been installed or |
  229.     | the arguments are out of range.                                      |
  230.     |                                                                      |
  231.     | * word g_SaveG34 (char *filespec, char *buf);                        |
  232.     |                                                                      |
  233.     | Save the image pointed to by buf to a G34 file.  The name of this    |
  234.     | file is specified by filespec.  OK is returned if successful.  ERROR |
  235.     | is returned if the library has not been installed, buf points to     |
  236.     | corrupt memory, the file could not be created, or the file could not |
  237.     | be written to.                                                       |
  238.     |                                                                      |
  239.     | * word g_SetAPage (word pageno);                                     |
  240.     |                                                                      |
  241.     | Set the active page to pageno (0 or 1).  OK is returned if success-  |
  242.     | ful.  ERROR is returned if the library has not been installed.       |
  243.     |                                                                      |
  244.     | * word g_SetColor (word _fcolor, word _bcolor);                      |
  245.     |                                                                      |
  246.     | Set the foreground and background rendering colors to _fcolor and    |
  247.     | _bcolor respectively.  OK is returned if successful.  If the library |
  248.     | has not been installed then ERROR is returned.                       |
  249.     |                                                                      |
  250.     | * word g_SetLineStyle (dword _style);                                |
  251.     |                                                                      |
  252.     | Set the line drawing style to _style.  See G320400.H for a list of   |
  253.     | useful style constants.  OK is returned if successful.  If the lib-  |
  254.     | rary has not been installed then ERROR is returned.                  |
  255.     |                                                                      |
  256.     | * word g_SetLineWidth (word _width);                                 |
  257.     |                                                                      |
  258.     | Set the line width to _width.  OK is returned if successful.  ERROR  |
  259.     | is returned if the library has not been installed.                   |
  260.     |                                                                      |
  261.     | * word g_SetPalette (word index, word r, word g, word b);            |
  262.     |                                                                      |
  263.     | Set the red, green, and blue components of the color entry found at  |
  264.     | index in the palette.  Index must range from 0-255.  OK is returned  |
  265.     | if successful.  ERROR is returned if library not installed/bad index |
  266.     |                                                                      |
  267.     ------------------------------------------------------------------------
  268.                      -  5 -
  269.  
  270.     ------------------------------------------------------------------------
  271.     |                                                                      |
  272.     | * word g_SetPixel (word x, word y);                                  |
  273.     |                                                                      |
  274.     | Set the pixel at location (x,y) on the active page.  OK is returned  |
  275.     | if successful.  ERROR is returned if the arguments are out of range. |
  276.     |                                                                      |
  277.     | * word g_SetVPage (word pageno);                                     |
  278.     |                                                                      |
  279.     | Set the visual page to pageno (0 or 1).  OK is returned if success-  |
  280.     | ful.  ERROR is returned if the library has not been installed.       |
  281.     |                                                                      |
  282.     | * word g_WriteChr (word chr);                                        |
  283.     |                                                                      |
  284.     | Draw a character on the active page whose ASCII code is contained in |
  285.     | chr (0-255).  The upper-left corner of this character is at the cur- |
  286.     | rent drawing position.  OK is returned if successful.  ERROR is      |
  287.     | returned if the library has not been installed.                      |
  288.     |                                                                      |
  289.     | * word g_WriteStr (const char *str);                                 |
  290.     |                                                                      |
  291.     | Draw a string on the active page.  This function calls g_WriteChr(). |
  292.     | OK is returned if successful.  ERROR is returned if the library has  |
  293.     | not been installed.                                                  |
  294.     |                                                                      |
  295.     | * word g_XorRect (word x, word y, char *buf);                        |
  296.     |                                                                      |
  297.     | Perform a bitwise XOR of the active page whose upper-left corner is  |
  298.     | specified by (x,y) with the memory array pointed to by buf.  OK is   |
  299.     | returned if successful.  ERROR is returned if the library has not    |
  300.     | been installed or the arguments are out of range.                    |
  301.     |                                                                      |
  302.     | MAC2G34 is a utility program for converting MacPaint images to G34   |
  303.     | format.  These are black and white images that have fixed dimensions |
  304.     | of 576 horizontal by 720 vertical pixels.  The syntax of the command |
  305.     | line is:                                                             |
  306.     |                                                                      |
  307.     |         mac2g34 filespec [x y nx ny]                                 |
  308.     |                                                                      |
  309.     | You can specify an offset into the file which is the upper-left cor- |
  310.     | ner.  You can also specify the size of the file which gives you the  |
  311.     | ability to crop an image as appropriate.                             |
  312.     |                                                                      |
  313.     | PCX2G34 is a utility program for converting PCX images to G34 for-   |
  314.     | mat.  You can convert 2-color (monochrome), 8-color, 16-color, or    |
  315.     | 256-color images.  The syntax of the command line is identical to    |
  316.     | MAC2G34.  You can specify an offset into the file for the upper-left |
  317.     | corner.  You can also specify a size for cropping.  However, the PCX |
  318.     | format allows you to having images with varying sizes, not one size  |
  319.     | as found in MACPAINT image files.                                    |
  320.     |                                                                      |
  321.     ------------------------------------------------------------------------
  322.                      -  6 -
  323.  
  324.     ------------------------------------------------------------------------
  325.     |                                                                      |
  326.     | VIEWG34 is a utility program for viewing G34 files.  The command     |
  327.     | line syntax is:                                                      |
  328.     |                                                                      |
  329.     |                viewg34 filespec                                      |
  330.     |                                                                      |
  331.     | where filespec is a G34 file.                                        |
  332.     |                                                                      |
  333.     | G320400 is a shareware program however I am not asking for a regis-  |
  334.     | tration fee.  I hope you enjoy using G320400.                        |
  335.     |                                                                      |
  336.     |                                                                      |
  337.     |                                                                      |
  338.     |                                                                      |
  339.     |                                                                      |
  340.     |                                                                      |
  341.     |                                                                      |
  342.     |                                                                      |
  343.     |                                                                      |
  344.     |                                                                      |
  345.     |                                                                      |
  346.     |                                                                      |
  347.     |                                                                      |
  348.     |                                                                      |
  349.     |                                                                      |
  350.     |                                                                      |
  351.     |                                                                      |
  352.     |                                                                      |
  353.     |                                                                      |
  354.     |                                                                      |
  355.     |                                                                      |
  356.     |                                                                      |
  357.     |                                                                      |
  358.     |                                                                      |
  359.     |                                                                      |
  360.     |                                                                      |
  361.     |                                                                      |
  362.     |                                                                      |
  363.     |                                                                      |
  364.     |                                                                      |
  365.     |                                                                      |
  366.     |                                                                      |
  367.     |                                                                      |
  368.     |                                                                      |
  369.     |                                                                      |
  370.     |                                                                      |
  371.     |                                                                      |
  372.     |                                                                      |
  373.     |                                                                      |
  374.     |                                                                      |
  375.     ------------------------------------------------------------------------
  376.                      -  7 -
  377.